/**
 * 
 */
package com.yidu.springbootdemo.permission.tools;

/**
 * 描述: 分页工具类
 * @author liandyao
 * @date 2019年6月13日 上午9:01:22
 * @version 1.0
 */
public class Pages {

	private int curPage ;//当前的页数
	private int limit  ;//显示的行数
	private int startRows ;//从哪行开始
	
	private int totalRows ;//总行数
	
	private int totalPage ;//总页数
	
	private int endRows;
	
	public int getEndRows() {
		if(curPage == 0) {
			endRows = limit;
		}else {
			endRows = limit * curPage;
		}
		
		return endRows;
	}
	public void setEndRows(int endRows) {
		this.endRows = endRows;
	}
	public int getTotalRows() {
		return totalRows;
	}
	public void setTotalRows(int totalRows) {
		this.totalRows = totalRows;
	}
	public int getTotalPage() {
		
		if(totalRows%limit==0) {
			totalPage = totalRows/limit ;
		}else {
			totalPage = totalRows/limit+1 ;
		}
		
		
		return totalPage;
	}
	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}
	public int getCurPage() {
		return curPage;
	}
	public void setCurPage(int curPage) {
		this.curPage = curPage;
	}
	public int getLimit() {
		return limit;
	}
	public void setLimit(int limit) {
		this.limit = limit;
	}
	public int getStartRows() {
		
		startRows =(curPage-1)*limit;
		
		return startRows;
	}
	public void setStartRows(int startRows) {
		this.startRows = startRows;
	}
	
	
	
	
	
}
